package com.zk.mockito.cases;

import org.junit.Test;

import java.util.List;

import static org.mockito.Mockito.*;

public class Case007_MakingSureInteractionNeverHappenedOnMock {

    /**
     * 验证某项交互从未发生
     */
    @Test
    public void testVerifyNeverHappened() {
        List mockOne = mock(List.class);

        //using mocks - only mockOne is interacted
        mockOne.add("one");

        //ordinary verification
        verify(mockOne).add("one");

        //verify that method was never called on a mock
        verify(mockOne, never()).add("two");
    }
}
